package me.zk.practice1.s;

/**
 * @author zhangkai
 * @date 2023/7/10 13:13
 */
public class LS9 {

    public boolean isPalindrome(int x) {

        if (x<0) {
            return false;
        }
        char[] chars = String.valueOf(x).toCharArray();
        int l = 0;
        int r = chars.length-1;
        while (l < r) {
            if (chars[l] != chars[r]) {
                return false;
            }
            l++;
            r--;

        }
        return true;
    }

    public static void main(String[] args) {
        System.out.println(new LS9().isPalindrome(1010));
    }
}
